Ext.define('extjs6test.view.core.DepartmentManager', {
    extend: 'extjs6test.view.base.BaseManager',
    requires: [
        'extjs6test.view.core.DepartmentGrid',
        'extjs6test.view.core.DepartmentManagerController'
    ],
    alias: 'widget.deptmngr',
    controller: {
        type: 'deptmngr'
    },
    layout: 'fit',
    bind: {
        title: '{departmentManagerTitle}'
    },
    glyph: 'xf0f2@FontAwesome',
    items: [
        {
            xtype: 'departmentgrid',
            reference: 'deptGrid'
        }
    ],
    initComponent: function () {
        Ext.apply(this, {
            dockedItems: this.dockedItems.concat([{
                dock: 'top',
                xtype: 'toolbar',
                items: [
                    {
                        xtype: 'form',
                        layout: 'column',
                        reference: 'queryForm',
                        defaults: {
                            padding: '0 8 0 0'
                        },
                        items: [
                            {
                                xtype: 'textfield',
                                bind: {
                                    fieldLabel: '{departmentManagerQueryBar.deptCodeLabel}'
                                },
                                name: 'departCode',
                                minLength: 1,
                                maxLength: 20
                            },
                            {
                                xtype: 'textfield',
                                bind: {
                                    fieldLabel: '{departmentManagerQueryBar.deptNameLabel}'
                                },
                                name: 'departName',
                                minLength: 1,
                                maxLength: 30
                            }
                        ]
                    }
                ]
            }])
        });
        this.callParent(arguments);
    }
});